{include file="page_header.tpl" page="view_report"}
<!-- Left column -->
<div class="span-12">
  <div class="span-11 append-bottom">
    <h3 class="alt">Diycity.kr &gt; <span id="where">{$address}</span></h3>
  </div>
  
  <div class="span-11">
    <div class="span-12">
      <h4 style="color:gray">{$reporter}님이 {$time}에 알려 왔습니다</h4>
    </div>
 
  <div class="span-11 append-bottom">
    <h4  style="color:gray">분류 : {$category} - from {$service_type}</h4>

    <h4  style="text-align:right;color:gray;font-weight:bold;">{if $state == 1}해결! @ {$modified}{elseif $state == 2}부분해결! @ {$modified}{/if}</h4>
{if $admin == 'true'}
    <h4  style="color:gray">email : {$email}</h4>
    <h4 style="color:red;font-weight:bold">
      REMOVE : <a onclick="moveWithConfirm('정말 삭제합니까?', 'lib/model_broker.php?model=problems&type=delete&id={$problem_id}')">DEL</a>
    </h4>

{if $state == 0}
    <h4 style="color:red;font-weight:bold">
      DO FIX! : <a onclick="moveWithConfirm('상태를 Fixed로 바꿉니다.', 'lib/model_broker.php?model=problems&type=problem_state&state=1&id={$problem_id}')">DO FIX</a>
    </h4>
    <h4 style="color:red;font-weight:bold">
      DO Partial FIX! : <a onclick="moveWithConfirm('상태를 Partial fixed로 바꿉니다.', 'lib/model_broker.php?model=problems&type=problem_state&state=2&id={$problem_id}')">Partial</a>
    </h4>
{elseif $state == 1 || $state == 2}
    <h4 style="color:red;font-weight:bold">
      DO UNFIX! : <a onclick="moveWithConfirm('상태를 Unfixed로 바꿉니다.', 'lib/model_broker.php?model=problems&type=problem_state&state=0&id={$problem_id}')">DO Unfix</a>
    </h4>
{/if}
    <h4 style="color:red;font-weight:bold">
      DO Modify : <a onclick="javascript:$('#modify_report_dialog').dialog('open')">Modify</a>
    </h4>
    <h4>ID : {$problem_id}</h4>
{/if}
{if $admin == 'true'}
    <!-- Report Hidden form -->
    <div id="modify_report_dialog" title="수정하기" style="display:none">
      <form action="lib/model_broker.php" method="post">
	<input type="hidden" name="problem_id" value="{$problem_id}" />
	<input type="hidden" name="type" value="modify_report" />
	<table>
	  <tr>
	    <th>제목</th>
	    <td><input type="text" value="{$subject}" name="subject" /></td>
	  </tr>
	  <tr>
	    <th>내용</th>
	    <td>
	      <textarea name="details">{$details}</textarea>
	    </td>
	  </tr>
	  
	  <tr>
	    <th>수정</th>
	    <td class="center">
	      <input style="width:300px" type="submit" value="수정" />
	    </td>
	  </tr>
	</table>
      </form>
    </div>
    <!-- ~Report Hidden form -->

    <!-- Update hidden form -->
    <div id="modify_update_dialog" title="수정하기" style="display:none">
      <form action="lib/model_broker.php" method="post">
	<input type="hidden" name="problem_id" value="{$problem_id}" />
	<input id="hidden_update_id" type="hidden" name="id" value="" />
	<input type="hidden" name="type" value="modify_update" />
	<table>
	  <tr>
	    <th>내용</th>
	    <td>
	      <textarea id="hidden_update_details" name="details"></textarea>
	    </td>
	  </tr>
	  
	  <tr>
	    <th>수정</th>
	    <td class="center">
	      <input style="width:300px" type="submit" value="수정" />
	    </td>
	  </tr>
	</table>
      </form>
    </div>
    <!-- ~Update hidden form -->

{/if}
  </div>
  <div class="span-11" style="background-color:white"> 
    <div class="prepend-1 span-9 append-bottom prepend-top">
      <h3>{$subject}</h3>
    </div>
  
    <div class="prepend-1 span-9">
      <p style="color:black">{$details|unescape|esc|nl2br|link}</p>
    </div>
    {if $img_href != null}
    <div class="append-bottom prepend-1 span-9 center">
      <a class="image_box" href="photos/?name={$img_href}.jpg"><img alt="" src="photos/{$img_href}" /></a>
    </div>
    {/if}
  </div>
 </div> 
 <div class="span-11">
<!-- AddThis Button BEGIN -->
<div style="margin-top:10px;" class="addthis_toolbox addthis_default_style append-bottom">
<a href="http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4b595f3c1492afbc" class="addthis_button_compact">Share</a>
<span class="addthis_separator">|</span>
<a class="addthis_button_facebook"></a>
<a class="addthis_button_myspace"></a>
<a class="addthis_button_google"></a>
<a class="addthis_button_twitter"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b595f3c1492afbc"></script>
<!-- AddThis Button END -->

 </div>
  <!-- <div class="span-12 right">신고</div> -->
  {if $updates != null}
  <div class="prepend-top span-12 last append-bottom"><h3 style="color:#458FA2"> * 이 제보에 추가된 내용</h3></div>
  {foreach from=$updates item=update}
  <div class="span-10 last append-bottom"> 
    <div class="span-9 prepend-1 last">
      {if $admin}
      <textarea id="update_details_{$update.id}" style="display:none">{$update.details}</textarea>
      {/if}
      <p style="color:black">{$update.details|unescape|esc|nl2br|link}</p>
    </div>
 
    {if $update.img != null}
    <div class="prepend-1 span-9 append-bottom center">
      <a href="photos/?name={$update.img}.jpg" class="image_box"><img alt="" src="photos/{$update.img}" /></a>
    </div>
    {/if}


    <div class="span-11 append-bottom last" style="border-bottom: 1px dotted #BBBBBB;margin-bottom: 10px;">
      <div class="prepend-1" style="color:gray">
	Updated by {if $update.reporter ==""}anonymous{else}{$update.reporter}{/if} at {$update.created_time}
	{if $admin}
	<a onclick="javascript:moveWithConfirm('정말 삭제합니까?', 'lib/model_broker.php?model=updates&type=delete&id={$update.id}&problem_id={$update.problem_id}')">DEL</a>
	<a onclick="javascript:bindAndOpenDialog('{$update.id}')">Modify</a>
	{/if}
      </div>
      {if $admin}
      <div class="prepend-1">email : {$update.email} </div>
      {/if}
    </div>
 </div>  
  {/foreach}
  {/if}
  
  <div class="span-12 last" style="margin-top:30px;"><h3  style="color:#458FA2"> * 이 제보에 내용 더하기</h3></div>


  <div class="append-1 span-11">
    <form action="lib/model_broker.php" method="post" enctype="multipart/form-data">
    <table class="form">
	<tr>
	  <th><label>내용 :</label></th>
	  <td><textarea rows="10" cols="40" class="text" name="details"></textarea></td>
	</tr>
	<tr>
	  <th>
	    <label>이름 : </label>
	  </th>
	  <td>
	    <input class="text" type="text" name="reporter" />
	  </td>
	</tr>

	<tr>
	  <th><label>email : </label></th>
	  <td><input class="text" type="text" name="email" /></td>
	</tr>

	<tr>
	  <th><label>사진 : </label></th>
	  <td><input  type="file" name="photo" /></td>
	</tr>

	<tr>
	  <th>&nbsp;</th>
	  <td class="center"><input style="width:200px" type="submit" value="제출" /></td>
	</tr>
      </table>
      <div>
	<input type="hidden" name="problem_id" value="{$problem_id}" />
	<input type="hidden" name="type" value="updates" />
      </div> 
    </form>
  </div>
</div>
<!-- ~Left column -->

<!-- Map area(Right column) -->
<div class="span-12 last">
  <!--<div id="rss-email" class="span-12 last">
	   <a href="#">E-Mail me new local problem</a>
  </div>-->
  <div id="map" class="span-12 last">
  </div>
  
  <div class="span-12 last" style="margin-top:20px">
    <div id="tabs">
      <ul>
	<li><a href="#news">지역 뉴스</a></li>
	<li><a href="#photos">지역 사진</a></li>
      </ul>

       <div id="news">

	<div id="news-list"></div>

	<div style="padding-bottom:10px;float:right;clear:both">Powered by <a href="http://naver.com">naver.com</a></div>
      </div>
      
      <div id="photos" style="margin:auto;padding-left:21px;">
      </div>
      
     
    </div>
  </div>
</div>
<!-- ~Map area(Right column) -->
{include file="page_footer.tpl"}
